<template>
  <view class="bgf mt-15 pb-15">
    <view class="linh-44 px-15 fz-15 fw-7 borderBottom">
      <text>合作佣金</text>
      <text class="fz-12 pl-10 fw-4" style="color: #ff6b6b">佣金计算基准为扣除手续费后的金额</text>
    </view>

    <!-- <view class="ma-15 pa-10 card">
          <view class="cellBox">
            <view>解锁方式一：</view>
            <view class="fw-7">查看联系方式</view>
          </view>
          <view class="cellBox">
            <view>解锁价格：</view>
            <view class="pliceText">{{ formatMoney(info.priceContact, true) }}</view>
          </view>
          <view class="cellBox">
            <view>佣金比例：</view>
            <view class="pliceText">{{ info.discount}}%</view>
          </view>
          <view class="cellBox">
            <view>预估佣金：</view>
            <view class="pliceText">{{ formatMoney(info.priceContactCompute, true) }}</view>
          </view>
        </view> -->

    <view class="ma-15 pa-10 card">
      <view v-if="info?.projectType !== CooperationProjectTypeEnum.MALL" class="cellBox">
        <view>解锁方式一：</view>
        <view class="fw-7">秘书处撮合沟通对接</view>
      </view>
      <view v-if="info?.projectType === CooperationProjectTypeEnum.MALL" class="cellBox">
        <view>合作项目：</view>
        <view class="fw-7">
          {{ info.cooperationType === CooperationTypeEnum.PUSH ? '推送' : '接入'
          }}{{ info?.projectName }}
        </view>
      </view>
      <view v-if="info?.projectType !== CooperationProjectTypeEnum.MALL" class="cellBox">
        <view>解锁价格：</view>
        <view class="pliceText">{{ formatMoney({ money: info?.pricePeople || 0, showFreeText: true }) }}</view>
      </view>
      <view class="cellBox">
        <view>佣金比例：</view>
        <view class="pliceText">{{ info?.discount }}%</view>
      </view>
      <view v-if="info?.projectType !== CooperationProjectTypeEnum.MALL" class="cellBox">
        <view>预估佣金：</view>
        <view class="pliceText">{{ formatMoney({ money: info?.pricePeopleCompute || 0, showFreeText: true }) }}</view>
      </view>
    </view>

    <view class="mx-10 mall-tips" v-if="info?.projectType === CooperationProjectTypeEnum.MALL">
      举例计算:产品单价
      <text class="text">100元</text>
      ，秘书处抽取佣金
      <text class="text">10元</text>
      ，设置合作组织分润比例为
      <text class="text">40%</text>
      ，则最终合作组织获得分润佣金
      <text class="text">10*40%=4元</text>
      ，本组织秘书处获得剩余佣金
      <text class="text">6元</text>
      。
    </view>

    <!-- <view class="mx-15 py-10">
          <view class="cellBox" v-if="info.apTime">
            <view>审核通过时间</view>
            <view>{{ info.apTime }}</view>
          </view>
          <view class="cellBox" v-if="info.colseTime">
            <view>取消合作时间</view>
            <view>{{ info.colseTime }}</view>
          </view>
        </view> -->
  </view>
</template>

<script setup lang="ts">
  import type { DetailsInfo } from '@/api/cooperation/types';
  import { CooperationProjectTypeEnum, CooperationTypeEnum } from '@/enums/cooperationEnum';
  import { formatMoney } from '@/utils/number';
  import type { PropType } from 'vue';

  const props = defineProps({
    info: Object as PropType<DetailsInfo>,
  });
</script>

<style lang="scss" scoped>
  .card {
    background-color: #f5f5f5;
    border-radius: 20rpx;
  }
  .cellBox {
    display: flex;
    justify-content: space-between;
    align-items: center;
    line-height: 60rpx;
    font-size: 28rpx;
  }
  .pliceText {
    color: #b47026;
    font-weight: bold;
  }

  .mall-tips {
    color: #999996;
    font-size: 24rpx;
    .text {
      color: #e29942;
    }
  }
</style>
